import 'package:casdon/modules/lifeCircle/data/model/life_subject_module.dart';
import 'package:casdon/modules/lifeCircle/data/model/life_topic_module.dart';

class LifeSubjectListState {
  final List<LifeSubjectState> data;
  int currentIndex = 0;

  LifeSubjectListState copyWith({
    List<LifeSubjectState>? data,
    int currentIndex = 0,
  }) {
    return LifeSubjectListState(
      data: data ?? this.data,
      currentIndex: currentIndex,
    );
  }

  factory LifeSubjectListState.initial() =>
      LifeSubjectListState(data: [], currentIndex: 0);

  LifeSubjectListState({required this.data, int currentIndex = 0});
}

class LifeSubjectState {
  final LifeSubjectModule? lifeSubject;
  final List<LifeTopicModule>? topicList;
  final int pageNum;
  final int totalSize;

  LifeSubjectState copyWith({
    LifeSubjectModule? lifeSubject,
    List<LifeTopicModule>? topicList,
    int? pageNum,
    int? totalSize,
  }) {
    return LifeSubjectState(
      lifeSubject: lifeSubject ?? this.lifeSubject,
      topicList: topicList ?? this.topicList,
      totalSize: totalSize ?? this.totalSize,
      pageNum: pageNum ?? this.pageNum,
    );
  }

  factory LifeSubjectState.initial() => LifeSubjectState(
    lifeSubject: null,
    topicList: null,
    totalSize: 0,
    pageNum: 0,
  );

  LifeSubjectState({
    required this.lifeSubject,
    required this.topicList,
    required this.totalSize,
    required this.pageNum,
  });
}
